package Cn.Sarkar.MMS.DataBaseDefinations.Independent

import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.*
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Contacts
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Countries
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Descriptions
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Names
import Cn.Sarkar.Entities.Common.Table

object Companies : Table("Company") {
    override var Comment: String = "شىركەت"
    val NameID = intColumn("NameID") unsigned true notNull true reference Names.ID comment "ئىسمى"
    val DescriptionID = intColumn("DescriptionID") unsigned true notNull true reference Descriptions.ID comment "چۈشەندۈرۈش"
    val ContactID = intColumn("ContactID") unsigned true notNull true reference Contacts.ID comment "ئالاقىلىشىش ئۇسۇلى"
    val ParentID = intColumn("ParentID") notNull true reference Companies.ID ignoreCreateForeignKey true comment "مۇشۇ شىركەتنىڭ بىر قاتلام يۇقىرى ئانا شىركىتى"
//    val Admins: MutableList<IPerson>
    val LicenceNumber = stringColumn("LicenceNumber") notNull true comment "تىجارەت كىنىشكىسى نومۇرى"
    val IdentificationCode = stringColumn("IdentificationCode") isN true size 16 comment "پەرىقلەندۈرۈش كودى"
    val AddrID = intColumn("AddrID") notNull true unsigned true reference Countries.ID comment "ئادېرسى"
//    val Applications: MutableList<IApplication>

    override val CATEGORY: Int = 9
}